#include "Color.h"
#include "Interval.h"

Color getOutColor(const Color& vColor)
{
	double IR = vColor.x();
	double IG = vColor.y();
	double IB = vColor.z();

	IR = linearToGamma(IR);
	IG = linearToGamma(IG);
	IB = linearToGamma(IB);

	static const CInterval Intensity(0.0, 0.999);
	int RByte = int(256.0 * Intensity.clamp(IR));
	int GByte = int(256.0 * Intensity.clamp(IG));
	int BByte = int(256.0 * Intensity.clamp(IB));

	return Color(RByte, GByte, BByte);
}
